<template>
    <div id="transfer">
        <van-cell-group inset class="mt20">
            <van-field v-model="transferInfo.username" center input-align="right" label="用户名" placeholder="请输入收款人用户名" />
        </van-cell-group>
        <van-cell-group inset class="mt20">
            <van-field v-model="transferInfo.money" center type="number" label-align="top" class="field-large" label="转账金额" placeholder="请输入转账金额">
                <template #extra>
                    <div class="icon-money">￥</div>
                </template>
            </van-field>
        </van-cell-group>
        <div class="fixed-bottom">
            <div class="btn-1 btn-1-main" @click="toSubmit()">转账</div>
        </div>
    </div>
</template>


<script>
export default {
    name: 'Transfer',
    data() {
        return {
            transferInfo:{
                username:'',
                money:''
            }
        }
    },
    created() { },
    methods: {
        toSubmit(){
            this.$api.transfer.create(this.transferInfo).then(res => {
                this.$router.push('/account/transfer/success/' + res.result.id);
                // console.log(res)
            }).finally(e => {});
        },
    }
}
</script>
